package cn.game.entry;

import java.util.LinkedList;
import java.util.List;

public class Player {
   private String name; // 玩家姓名
   private List<Card> cards; // 手中的牌
   private boolean isBanker; // 是否庄家  true:是     false:否
   private int position; // 玩家坐的位置
   private int winTimes ; // winTimes
   
   public Player(String name,boolean isBanker,int position){
	   cards = new LinkedList<Card>();
	   this.isBanker = isBanker;
	   this.position = position;
	   this.name = name;
   }
   
   public Player(){
	   cards = new LinkedList<Card>();
   }
   
   /**
    * 抓一张牌
    * @return
    */
   public void draw(Card card) {
      cards.add(card);
   }
   
   /**
    * 抓多张牌
    * @param mCards
    */
   public void drawMore(List<Card> mCards){
	   cards.addAll(mCards);
   }
   /**
    * 出牌
    */
   public Card play() {
	   return cards.remove(0);
   }

	public List<Card> getCards() {
		return cards;
	}

	public void setCards(List<Card> cards) {
		this.cards = cards;
	}

	public boolean isBanker() {
		return isBanker;
	}

	public void setBanker(boolean isBanker) {
		this.isBanker = isBanker;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getWinTimes() {
		return winTimes;
	}

	public void setWinTimes(int winTimes) {
		this.winTimes = winTimes;
	}

	public void addWinTimes(int addNumber) {
		
		this.winTimes = this.winTimes + addNumber;
	}
	   
	   @Override
		public String toString() {
			// TODO Auto-generated method stub
			return this.name+"\t"+this.winTimes+"\t"+this.cards.size();
		}
}
